package org.apache.rocketmq.example.quickstart.base;

import org.apache.rocketmq.client.producer.DefaultMQProducer;

/**
 * 基础生产者
 */
public class BaseProducer {

    private DefaultMQProducer producer;

    public DefaultMQProducer getInstance() {
        if (producer != null) {
            return producer;
        }

        producer = new DefaultMQProducer("producer-group-1");
        producer.setNamesrvAddr("39.107.66.31:9876");
        return producer;
    }
}
